<template>
	<view class="page" @touchmove.stop.prevent="moveHandle">
		<view style="height: calc(100vh - 1090rpx);" @click="close"></view>
		<view class="goods-param-wrap">
			<view class="goods-wrap">
				<text>商品参数</text>
			</view>
			<scroll-view scroll-y class="scroll-param">
				<view class="weight" v-for="(item,index) in params" :key="index">
					<text style="margin-left: 14rpx;">{{item.title}}</text>
					<text style="margin-right: 13rpx;">{{item.params}}</text>
				</view>
			</scroll-view>
			<view class="close" @click="close">
				<text>关闭</text>
			</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			params: {
				type: Array,
				defalut: []
			},
			goodsPrice: {
				type: Array,
				default() {
					return []
				}
			}
		},
		data() {
			return {
				
			}
		},
		methods: {
			close() {
				// #ifdef APP-PLUS|| MP-WEIXIN
				this.$parent.closeGoodsParamPopup();
				// #endif
				// #ifndef APP-PLUS|| MP-WEIXIN
				this.$parent.$parent.closeGoodsParamPopup();
				// #endif
				
			},
			moveHandle() {
			  return;
			},
			toCart() {
				this.paramsToCart();
			
			},
			paramsToCart() {
				this.$api.paramsToCart({
					bizpro_id: this.b_id,
					standard_value1: this.colorList[this.currentIndex],
					standard_value2: this.sizeList[this.colorIndex],
					buy_num: this.count
				}).then(res => {
					uni.showToast({
						title: '添加购物车成功'
					})
				})
			},
			//立即下单
			toOrder() {
				this.$api.getCheckOrder({
					buy_num: this.count,
					price: this.standard_sale_price,
					bizpro_imgurl: this.imgUrl,
					bizpro_name: this.bizpro_name,
					bizpro_number: this.bizpro_number,
					bizpro_lable: this.bizpro_lable,
					supplier_id: this.supplier_id,
					standard_value1: this.colorList[this.currentIndex],
					standard_value2: this.sizeList[this.colorIndex],
					bizpro_id: this.b_id,
			
				}).then(res => {
					uni.navigateTo({
						url: '/pages/order/OrderConfirm?order_id=' + res.data.orderId
					})
				})
			
			},
		}
	}
</script>

<style scoped>
	.page {
		position: fixed;
		top: 0;
		z-index: 1000;
		width: 100%;
		height: 100vh;
		background: rgba(0,0,0,0.4);
	}
	.goods-param-wrap {
		position: fixed;
		bottom: 0;
		width: 750rpx;
		height: 1090rpx;
		background:rgba(255,255,255,1);
		padding-bottom: 20rpx;
	}
	.goods-wrap {
		width: 750rpx;
		height: 144rpx;
		line-height: 144rpx;
		background: rgba(254,177,71,1);
	}
	.goods-wrap text {
		font-size: 40rpx;
		font-family: PingFang SC;
		font-weight: bold;
		color: rgba(51,51,51,1);
		margin-left: 296rpx;
		
	}
	.scroll-param {
		width: 750rpx;
		height: 820rpx;
	}
	.weight {
		display: flex;
		justify-content: space-between;
		align-items: center;
		width: 670rpx;
		min-height: 108rpx;
		height: auto;
		/* display: table; */
		margin-left: 40rpx;
		border-bottom: 1rpx solid rgba(204,204,204,1);;
	}
	.weight text {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(0,0,0,1);
		max-width: 400rpx;
		width: auto;
		display: table;
	}
	.close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 622rpx;
		height: 86rpx;
		background: #FEB147;
		margin-left: 64rpx;
		margin-top: 20rpx;
	}
	.close text {
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(255,255,255,1);
	}
	.price-wrap {
		display: flex;
		justify-content: space-around;
		align-items: center;
		width: 750rpx;
		height: 100rpx;
		margin-top: 70rpx;
		border: 1rpx solid #eee;
	}
	.price {
		font-size: 34rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(255,77,77,1);
	}
	.operation {
		display: flex;
		width: 380rpx;
		height: 70rpx;
	}
	.add-cart {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 186rpx;
		height: 66rpx;
		border: 2rpx solid rgba(254,177,71,1);
		border-radius:35rpx 0rpx 0rpx 35rpx;
	}
	.add-cart text {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(254,177,71,1);
	}
	.buy-now {
		display: flex;
		justify-content: center;
		align-items: center;
		width: 190rpx;
		height: 70rpx;
		background: rgba(253,149,47,1);
		border-radius: 0rpx 35rpx 35rpx 0rpx;
	}
	.buy-now text {
		font-size: 30rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: rgba(255,238,238,1);
	}
</style>